<?
//设置需要搜索的表格的前缀后缀
$table_suffix="login_admin";
$table=$table_Prefix.$table_suffix;
//设置需要搜索的表格的前缀后缀


//设置需要搜索的表格的排序项和升降项
$sort_by = "nid";
$sort_order = "desc";
//设置需要搜索的表格的排序项和升降项
?>



<?

function check_admin_type()
{
 

//根据传过来的session账户名，确定账户的类型，从而判断权限

global $table_Prefix;
//设置需要搜索的表格的前缀后缀
$table_suffix="login_admin";
$table=$table_Prefix.$table_suffix;
//设置需要搜索的表格的前缀后缀


//设置需要搜索的表格的排序项和升降项
$sort_by = "nid";
$sort_order = "desc";
//设置需要搜索的表格的排序项



$check_name=$_SESSION['username'] ;

$result = mysql_query("select * from $table where name = '$check_name' ");
	
while($row = mysql_fetch_array($result))
  {
  $admin_nid=$row['nid'];
  $admin_type_now=$row['admin_term'];
  $admin_password=$row['admin_password'];
  }
 

  
if($admin_type_now==1)
{
	return "admins";
	}
	
elseif($admin_type_now==2)
{
	return "editor";
	}

}



?>


<?
//获取指定板块的伪静态url================

function menu_url($str)
{
    global $table_Prefix;
    global $sys_list_table;
    global $sys_term_table;
    global $sys_plate_table;
//设置需要搜索的表格的前缀后缀
    $table_suffix=$sys_plate_table;
    $table=$table_Prefix.$table_suffix;
//设置需要搜索的表格的前缀后缀

    $result = mysql_query("SELECT * FROM $table where mid = '$str' ");

    while($row = mysql_fetch_array($result))
    {
        $url=$row['url'];
    }

    return $url;

}

//获取指定板块的名称
function menu_name($str)
{
    global $table_Prefix;
    global $sys_plate_table;
//设置需要搜索的表格的前缀后缀
    $table_suffix = $sys_plate_table;
    $table = $table_Prefix . $table_suffix;
//设置需要搜索的表格的前缀后缀

    $result = mysql_query("SELECT * FROM $table where mid = '$str' ");

    while ($row = mysql_fetch_array($result)) {
        $name = $row['name'];
    }

    return $name;

}


//获取指定板块的名称
function menu_title($str)
{
    global $table_Prefix;
    global $sys_plate_table;
    $table_suffix = $sys_plate_table;
    $table = $table_Prefix . $table_suffix;

    $result = mysql_query("SELECT * FROM $table where mid = '$str' ");

    while ($row = mysql_fetch_array($result)) {
        $title = $row['title'];
    }

    return $title;

}


//获取指定板块的名称
function menu_term($str)
{
    global $table_Prefix;
    global $sys_plate_table;
//设置需要搜索的表格的前缀后缀
    $table_suffix = $sys_plate_table;
    $table = $table_Prefix . $table_suffix;
//设置需要搜索的表格的前缀后缀

    $result = mysql_query("SELECT * FROM $table where mid = '$str' ");

    while ($row = mysql_fetch_array($result)) {
        $term = $row['term'];
    }

    return $term;

}


//获取指定板块的名称
function menu_page_list($str)
{
    global $table_Prefix;
    global $sys_plate_table;
//设置需要搜索的表格的前缀后缀
    $table_suffix = $sys_plate_table;
    $table = $table_Prefix . $table_suffix;
//设置需要搜索的表格的前缀后缀

    $result = mysql_query("SELECT * FROM $table where mid = '$str' ");

    while ($row = mysql_fetch_array($result)) {
        $page_list = $row['page_list_num'];
    }

    return $page_list;

}


//获取指定板块的名称
function menu_term_publish($str)
{
    global $table_Prefix;
    global $sys_plate_table;
//设置需要搜索的表格的前缀后缀
    $table_suffix = $sys_plate_table;
    $table = $table_Prefix . $table_suffix;
//设置需要搜索的表格的前缀后缀

    $result = mysql_query("SELECT * FROM $table where mid = '$str' ");

    while ($row = mysql_fetch_array($result)) {
        $term_publish = $row['term_public'];
    }

    return $term_publish;

}


?>